package com.cn.jdia.tas.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cn.jdia.tas.dao.S_interestMapper;
import com.cn.jdia.tas.model.S_interest;
import com.cn.jdia.tas.service.IInterestService;

@Service("interestService")
public class IInterestServiceImpl implements IInterestService {

	@Resource
	private S_interestMapper interestDao;
	
	@Override
	public List<String> getInterestList(String id) {
		
		List<S_interest> list=this.interestDao.queryInterestList(id);
		List<String> iList=new ArrayList<>();
		
		if(list!=null){
			for(S_interest s:list){
				iList.add(s.getInterestid());
			}	
		}
		
		return iList;
	}

	@Override
	public int insertInterestRecord(S_interest record) {
		return this.interestDao.insert(record);
	}

	@Override
	public int deleteInterestRecord(String sponsorid, List<String> intersetids) {	
		return this.interestDao.deleteSelectives(sponsorid, intersetids);
	}

}
